class Solution {
public:
    bool isAnagram(string s, string t) {
        int hash[26] = { 0 };
        for (auto c : s)
        {
            hash[c - 'a']++;
        }
        for (auto c : t)
        {
            hash[c - 'a']--;
        }
        for (auto e : hash)
        {
            if (e != 0) return false;
        }
        return true;
    }
};